package sea;

//import java.awt.Toolkit;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
import org.jdesktop.application.Application;
import org.jdesktop.application.SingleFrameApplication;
import sea.util.PublicParam;


/**
 *
 * This main class of the application
 * 
 * @author  Zhirun Ding
 * 
 * Created on 11/07/2012
 * 
 */


public class SimHyAGui extends SingleFrameApplication {
    
    

    /**
     * At startup create and show the main frame of the application.
     */
    @Override protected void startup() {
//        try {                    
            SimHyAMainFrame mainFrame = new SimHyAMainFrame();
            //mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
            //mainFrame.setVisible(true);
            show(mainFrame);
            //PublicParam.SimHyAMainFrame = mainFrame;
            //getContext().getSessionStorage().restore(mainFrame, "session.xml");
//        } catch (IOException ex) {
//            Logger.getLogger(SimHyAGui.class.getName()).log(Level.SEVERE, null, ex);
//        }
    }

    /**
     * This method is to initialize the specified window by injecting resources.
     * Windows shown in our application come fully initialized from the GUI
     * builder, so this additional configuration is not needed.
     */
    @Override protected void configureWindow(java.awt.Window root) {
    }

    /**
     * A convenient static getter for the application instance.
     * @return the instance of SimHyAGui
     */
    public static SimHyAGui getApplication() {
        return Application.getInstance(SimHyAGui.class);
    }

    /**
     * Main method launching the application.
     */
    public static void main(String[] args) {    
        launch(SimHyAGui.class, args);
        //SimHyAGui.getApplication().startup();
    }
}
